﻿using System.Windows.Media.Imaging;

using Gonte.UI;
using Gonte.Wpf.Controls.ResourceManagers;
using Gonte.Wpf.Controls.ViewModel;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MyWpfControlsTest
{
    [TestClass()]
    public class ItemObjectViewModelTest
    {
        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        [UserInterface(
        LabelProperty = "Name",
        IconUri = @"pack://application:,,/Images/Item.jpg")]
        public class ChildTreeItem
        {
            private string name_;

            public string Name
            {
                get { return name_; }
                set { name_ = value; }
            }
        }

        //[TestMethod()]
        //public void ItemObjectViewModelConstructorTest()
        //{
        //    // Set up the image to test
        //    BitmapImage image = new BitmapImage();
        //    string imageUri = @"pack://application:,,/Images/Item.jpg";
        //    ImageManager_Accessor.Images.Add(imageUri, image);

        //    ChildTreeItem child = new ChildTreeItem();
        //    child.Name = "Child Name";

        //    ItemObjectViewModelInfo viewModelInfo = (ItemObjectViewModelInfo)ItemObjectViewModelInfo.GetInfo(child.GetType());
        //    ItemObjectViewModel viewModel = new ItemObjectViewModel(viewModelInfo, new ContentViewModel(viewModelInfo, null, new object()), child);

        //    Assert.AreEqual("Child Name", viewModel.Label);
        //    Assert.AreEqual(@"pack://application:,,/Images/Item.jpg", viewModel.IconUri);
        //    Assert.AreEqual(image, viewModel.IconSource);
        //}
    }
}
